<!DOCTYPE html>
<html lang="en">

<head th:replace="/views/mobile/live/partials/head"></head>
<title th:inline="text">[[${channel.topic}]]</title>

<body>
    <header id="edit-header">
        <div class="navbar navbar-default">
            <a class="navbar-brand abs-left" th:href="@{${'/live/broadcast/'+channel.id}}">后退</a>
            <div class="navbar-tit">
                <h3>发直播</h3>
                <small th:inline="text">[[${#httpSession.getAttribute('profile.login').name}]]</small>
            </div>
            <a class="navbar-brand abs-right" href="#" ontouchstart="sendLiveMsg(this)">发送</a>
        </div>
    </header>
    <div id="edit-content">
        <form id="liveMsgJSON" name="liveMsgJSON" action="/faxsun-info/api/v1/live/post" method="post">
            <input name="channelId" style="display:none" th:attr="value=${channel.id}"/>
            <input name="user.id"  style="display:none" th:attr="value=${#httpSession.getAttribute('profile.login').id}"/>
            <textarea name="content.text" class="edit-textarea" placeholder="说点什么吧(图片一次最多只能上传3张)……" id="textArea"></textarea>
            <div class="footer-nav">
                <div id="edit-content-img" class="clearfix">
                    <!-- <a href="#" class="edit-btn" id="chooseUploadImg" style="display:none" ><span class="glyphicon glyphicon-camera" aria-hidden="true"></span></a> -->
                    <a href="#" class="edit-btn" id="chooseUploadImg" ><span class="glyphicon glyphicon-camera" aria-hidden="true"></span></a>
                </div>
            </div>
            <input type='submit' value="submit" id="live_form_submit" style="display:none"/>
        </form>
        <div class="row upload-row" id="img_tmp_container">
            <!-- <div class="col-xs-4 upload-img-item" id="chooseUploadImgPlus" style="display:none"><span class="add-img">+</span></div> -->
            <div class="col-xs-4 upload-img-item" id="chooseUploadImgPlus"><span class="add-img">+</span></div>
        </div>
    </div>
    <div class="mark-bg" style="display:none">
        <span class="loading"></span>
        <span class="load-info">正在发送……</span>
    </div>

    <input id="channelId_hidden" th:attr="channelid=${channel.id}" style="display:none" />
<script th:inline="javascript">
    
    $(function(){
         if("ADMIN"==[[${role}]] || "MANAGER"==[[${role}]]){
                 wechatJsapi.init();
                 editImgList();
         }
         else{
            alert("您没有上传的权限,将跳转回直播页");
            window.location.href="/faxsun-info/live/broadcast/"+$("#channelId_hidden").attr("channelid");
         }
       
    });
</script>
</body>

</html>
